<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

class Trangchu extends CI_Controller {

	public function index()
	{
		$this->load->model('model_trangchu');

		$lop['lop1'] = $this->model_trangchu->monhoc(1);
		$lop['lop2'] = $this->model_trangchu->monhoc(2);
		$lop['lop3'] = $this->model_trangchu->monhoc(3);
		$lop['lop4'] = $this->model_trangchu->monhoc(4);
		$lop['lop5'] = $this->model_trangchu->monhoc(5);

		$data['thongbao'] = $this->model_trangchu->thongbao();
		$data['baigiang'] = $this->model_trangchu->baigiang();
		$data['baitap'] = $this->model_trangchu->baitap();

		$this->load->view('view_header');
		$this->load->view('view_login');
		$this->load->view('view_leftmenu', $lop);
		$this->load->view('view_main', $data);
		$this->load->view('view_footer');
	}

	public function xemthongbao($mathongbao) {
		$this->load->model('model_trangchu');

		$data['lop1'] = $this->model_trangchu->monhoc(1);
		$data['lop2'] = $this->model_trangchu->monhoc(2);
		$data['lop3'] = $this->model_trangchu->monhoc(3);
		$data['lop4'] = $this->model_trangchu->monhoc(4);
		$data['lop5'] = $this->model_trangchu->monhoc(5);

		$thongbao['thongbao'] = $this->model_trangchu->noidungthongbao($mathongbao);

		$this->load->view('view_header');
		$this->load->view('view_login');
		$this->load->view('view_leftmenu', $data);
		$this->load->view('view_thongbao', $thongbao);
		$this->load->view('view_footer');
	}

	public function xembaigiang($mabaigiang) {
		$this->load->model('model_trangchu');

		$data['lop1'] = $this->model_trangchu->monhoc(1);
		$data['lop2'] = $this->model_trangchu->monhoc(2);
		$data['lop3'] = $this->model_trangchu->monhoc(3);
		$data['lop4'] = $this->model_trangchu->monhoc(4);
		$data['lop5'] = $this->model_trangchu->monhoc(5);

		$baigiang['baigiang'] = $this->model_trangchu->noidungbaigiang($mabaigiang);
		$baigiang['baitap'] = $this->model_trangchu->baitaplienquan($mabaigiang);

		$this->load->view('view_header');
		$this->load->view('view_login');
		$this->load->view('view_leftmenu', $data);
		$this->load->view('view_baigiang', $baigiang);
		$this->load->view('view_footer');
	}

	public function lop($lop) {
		$this->load->model('model_trangchu');

		$lopq['lop1'] = $this->model_trangchu->monhoc(1);
		$lopq['lop2'] = $this->model_trangchu->monhoc(2);
		$lopq['lop3'] = $this->model_trangchu->monhoc(3);
		$lopq['lop4'] = $this->model_trangchu->monhoc(4);
		$lopq['lop5'] = $this->model_trangchu->monhoc(5);

		$data['lop'] = $this->model_trangchu->GetLop($lop);
		$data['khoi'] = $lop;

		$this->load->view('view_header');
		$this->load->view('view_login');
		$this->load->view('view_leftmenu', $lopq);
		$this->load->view('view_lop', $data);
		$this->load->view('view_footer');
	}
}

